package org.apache.flink.runtime.allocatedeploy;

import java.util.concurrent.CompletableFuture;

import org.apache.flink.runtime.ResourceException;
import org.apache.flink.runtime.allocatedeploy.execution.Execution;

/** Default implementation of {@link ExecutionOperations}. */
public class DefaultExecutionOperations implements ExecutionOperations {

    @Override
    public void deploy(Execution execution) throws ResourceException {
        execution.deploy();
    }

    @Override
    public CompletableFuture<?> cancel(Execution execution) {
        execution.cancel();
        return execution.getReleaseFuture();
    }

    @Override
    public void markFailed(Execution execution, Throwable cause) {
        execution.markFailed(cause);
    }
}
